﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="CategoryManage.aspx.cs" Inherits="Hengbei.Web.Admin.CategoryManage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:EntityDataSource ID="edsCategories" runat="server" 
        ConnectionString="name=HengbeiEntities" DefaultContainerName="HengbeiEntities" 
        EnableDelete="True" EnableFlattening="False" EnableInsert="True" 
        EnableUpdate="True" EntitySetName="ArticleCategories">
    </asp:EntityDataSource>
    <asp:ScriptManager ID="smCategories" runat="server">
    </asp:ScriptManager>
    <div style="text-align:center;"><h3>类别管理</h3></div>
    <br />
    <br />
    <asp:Label ID="lblInsert" runat="server" CssClass="Label" Text="插入新的类别："></asp:Label>
    <br />
    <asp:DetailsView ID="dvCategory" runat="server" Height="50px" Width="255px" 
        AutoGenerateRows="False" CellPadding="4" DataKeyNames="ID" 
        DataSourceID="edsCategories" ForeColor="#333333" GridLines="None"
        DefaultMode="Insert" oniteminserted="dvCategory_ItemInserted">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
        <EditRowStyle BackColor="#999999" />
        <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
        <Fields>
            <asp:BoundField DataField="Name" HeaderText="类别名称" SortExpression="Name" />
            <asp:BoundField DataField="Description" HeaderText="类别描述" 
                SortExpression="Description" />
            <asp:CommandField ShowInsertButton="True" InsertText="插入" 
                ShowCancelButton="False" />
        </Fields>
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
    </asp:DetailsView>
    <br />
    <asp:Label ID="lblManage" runat="server" CssClass="Label" Text="管理已有类别："></asp:Label>
    <asp:UpdatePanel ID="upCategories" runat="server">
        <ContentTemplate>
            <asp:GridView ID="gvCategories" runat="server" AllowPaging="True" 
            AllowSorting="True" DataSourceID="edsCategories" Width="100%" 
            AutoGenerateColumns="False" CellPadding="4" DataKeyNames="ID" 
            ForeColor="#333333" GridLines="None" 
                onrowdatabound="gvCategories_RowDataBound">
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:CommandField ShowEditButton="True" CancelText="取消" 
                        DeleteText="" EditText="编辑" UpdateText="保存" />
                    <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" 
                    SortExpression="ID" InsertVisible="False" Visible="False" />
                    <asp:BoundField DataField="Name" HeaderText="类别名称" SortExpression="Name" />
                    <asp:BoundField DataField="Description" HeaderText="类别描述" 
                    SortExpression="Description" />
                    <asp:CommandField DeleteText="删除" ShowDeleteButton="True" />
                </Columns>
                <EditRowStyle BackColor="#999999" />
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <div class="GridDiv">
    </div>
</asp:Content>
